<?php
include('connect.php');

$sql = "select id, nickname, photo from sf_guard_user where is_online=1";
$rez = mysql_query($sql);
$str = '';
while(list($id,$$name,$photo)=mysql_fetch_row($rez))
{
   $str.='<a href="/_index.php/multichat/call?id='.$id.'"><img src="/uploads/users/avatar/thumbnail/'.$photo.'">';
}
echo $str;
?>